This invention relates to an image processing method and apparatus. More particularly, the invention relates to an image processing method and apparatus for compressing and saving image data and expanding the image data when the data is printed or displayed.
In the prior art, image data or data in page description language (abbreviated to PDL below) that has been transferred from a computer to an image output unit such as a printer is developed in a controller of the image output unit. While this is being performed, bitmap data resulting from development is sent to the engine of a printer.
However, in a case where the content developed in complicated in nature, the development of the data cannot keep pace with printing. In such case the bitmap data that has been developed is stored temporarily in a memory (referred to as a "page memory" below). When all data has been fully developed and the bitmap data has been stored in memory, the bitmap data is then sent to the printer engine successively from the beginning of the data.
In a scenario where the paper printed on is of size A3 and has a resolution of 600 dpi, the quantity of data of the full bitmap is 8 MB, even if there is only one bit per pixel (i.e. each pixel is represented by a binary value). Thus a large-capacity memory is required, resulting in a more costly printer.
To solve this problem, an arrangement of the kind shown in FIG. 1 has been considered.
The arrangement of FIG. 1 includes an interface 101 for accepting data from a computer, a temporary buffer 102 for temporarily storing the data that has been accepted from the computer, a paint unit 103 for developing the data that has been accepted from the computer, a band buffer 104 for writing bitmap data developed by the paint unit 103, a coder 105 for compressing and coding the bitmap data from the band buffer 104, a page buffer 106 for storing the data compressed and coded by the coder 105, a decoder 107 for decoding the coded data in the page buffer 106, and a printer engine 108 for printing the bitmap data obtained by the decoding operation of the decoder 107.
The data accepted from the computer is eventually output to the printer engine 108 upon passing through the above-mentioned blocks in the order mentioned.
By virtue of this arrangement, the 8-MB capacity required for the page memory prior to compression is reduced to one-half or one-fourth. Though the band memory 104 is required anew and the amount of memory thus increases correspondingly, the total amount of memory required overall is reduced if the unit (referred to as a "band") in which the data is developed is made 1/16 to 1/20 of one page.
Since the decoder 107 and engine 108 are directly connected in the arrangement of FIG. 1, the data output speed of the decoder 107 and the data input speed of the engine 108 must be made to agree. As there are a variety of coding/decoding methods available, it will suffice to employ a coding/decoding method that satisfies this requirement.
In order to reduce the capacity of the page memory as much as possible to satisfy the demand for lower cost in this case, it is desired that the compression method used assure that the lowest value of the compression rate will exceed a given fixed value for any kind of bitmap data (text data, graphics data, images, etc.).
Some candidates are JBIG coding having a learning function whereby the two-dimensional features of bitmap data to be compressed are learned, standardized as ISO/IEC International Standard 11544, Q-Coder (proposed by IBM Corporation) which greatly influenced the JBIG coding, arithmetic coding (proposed by Langdon and Rissanen) which is the basis of the Q-Coder, and so on.
With JBIG coding, learning is performed by updating the content of a RAM which stores a predicted state. The learning operation (the updating of the content of the RAM) occurs at irregular intervals. When it takes place, the time required for the coding/decoding processing is prolonged owing to the writing of data to the memory. Conversely, the time required for the coding/decoding processing is shortened in instances where learning need not be performed (i.e. when RAM updating need not be carried out).
Accordingly, in a case where coded data is decoded by the JBIG method, the data output rate of the decoder is not fixed and, hence, the output cannot be delivered to the printer engine directly. In particular, in a printer engine that relies upon electrophotography, once the engine has been started, it cannot be stopped until the printing of one full page is completed.
In order to deal with this, a FIFO (first in, first out) memory 109 is provided between the decoder 107 and engine 108. The bitmap data output by the decoder 107 is smoothed in terms of time by the FIFO memory 109 before being delivered to the engine 108.
In a case where the two-dimensional features of the bitmap data to be compressed are not uniform, the compression rate is lowered and learning takes place more frequently, both the coding speed and decoding speed decline by a wide margin.
More specifically, consider a scenario in which coding and decoding can be carried out at 20 MHz when updating of the content of the RAM does not take place, with the coding/decoding operating frequency falling to 10 MHz when the RAM is updated.
The average operating period (which is the reciprocal of the operating frequency) is a linear function of the updating ratio. That is, the average operating period increases linearly with respect to a rise in the updating ratio (see FIG. 8).
When ratio of RAM updating is 1/4, the average operating frequency is obtained as follows: EQU 1/[(1/10).times.(1/4)+(1/20).times.(3/4)]=16.0 MHz
When ratio of RAM updating is 1/2, the average operating frequency is obtained as follows: EQU 1/[(1/10).times.(1/2)+(1/20).times.(1/2)]=13.3 MHz
Accordingly, if the RAM updating ratio is greater than 1/2 in a situation where the data input frequency of the printer engine is 13.3 MHz or greater, printout cannot be performed in good order.
If the decoding speed continues to be lower than the data input speed of the printer engine or temporarily declines by a wide margin, a problem which arises is that the bitmap data will no longer be able to be temporally smoothed by the FIFO. In such case a printout cannot be obtained.